/**      
 * @file		notPolymorphism.cpp
 * @description		This example demonstrates the need for polymorphic behavior.
 * @course		CSCI 123 Section 00000
 * @assignment 
 * @date		mm/dd/yyyy
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */
#include <iostream>
using namespace std;

/**
 * Simple Base Class Example
 * @author: Brad Rippe (brippe@fullcoll.edu)
 */
class BaseClass {
public:
	
	/**
	 * Returns a string representation of the object
	 * @return the string representation
	 */
	string toString() {
		return "Base Class";
	}
};


/**
 * Simple Derived class
 * What's the relationship between BaseClass and Derived class?
 * @author: Brad Rippe (brippe@fullcoll.edu)
 */
class DerivedClass1: public BaseClass {
	
	/**
	 * Returns a string representation of the object
	 * Is this overloading or redefining the function?
	 * @return the string representation
	 */
	string toString() {
		return "DerivedClass 1";
	}
};

/**
 * Simple Derived from a Derived class
 * This class makes the BaseClass a grandparent
 * @author: Brad Rippe (brippe@fullcoll.edu)
 */
class DerivedClass2: public DerivedClass1 {

	/**
	 * Returns a string representation of the object
	 * Is this overloading or redefining the function?
	 * What's the difference? (more good exam questions)
	 * @return the string representation
	 */
	string toString() {
		return "DerivedClass 2";
	}
};

/**
 * Outputs the toString result to the screen
 * @param aClass the class to output the result of toString
 */
void displayObject(BaseClass aClass) {
	// data() is from the string class
	cout << aClass.toString().data() << endl;
}

/**
 * @return zero if the application executes successfully
 */
int main() {
	// Construct a parameter of each of the types:
	// BaseClass
	// DerivedClass1
	// and DerivedClass2
	displayObject(BaseClass());
	displayObject(DerivedClass1());
	displayObject(DerivedClass2());
	return 0;
}
